import Character
import pygame

image=pygame.image.load("emerald.bmp")
image.set_colorkey((255,0,255))

class Collectable(Character.Character):
	def __init__(self,x=0,y=0,mass=40):
		Character.Character.__init__(self,x=x,y=y,mass=mass)
		self.image=image
	def die(self):
		pass
	def hit_by_object(self,objecto):
		if objecto.canCollect:
			self.collectedBy(objecto)
	def collectedBy(self,him):
		self.takenBy(him)
		him.cur_room.collectablesList.remove(self)
		self.totalUnbound()
		#him.cur_room.plat_coll_lu.remove(self)
	def takenBy(self,him):
		him.inventory.append(self)
	def drawingInformation(self):
		import random
		r=random.randint(0,int(0.5*self.getHeight()))
		return (self.x-0.5*self.getWidth(),self.y+self.getHeight()+r),self.image
	def getHeight(self):
		return self.image.get_height()
	def getWidth(self):
		return self.image.get_width()